package model

import (
	"gorm.io/gorm"
	"time"
)

type Users struct {
	UserId       uint           `gorm:"column:user_id;type:bigint UNSIGNED;comment:ID;primaryKey;not null;" json:"user_id"`                       // ID
	Phone        string         `gorm:"column:phone;type:char(11);comment:手机号;not null;" json:"phone"`                                            // 手机号
	Password     string         `gorm:"column:password;type:char(36);comment:密码;not null;" json:"password"`                                       // 密码
	Nickname     string         `gorm:"column:nickname;type:varchar(20);comment:昵称;not null;" json:"nickname"`                                    // 昵称
	AvatarUrl    string         `gorm:"column:avatar_url;type:varchar(300);comment:头像;not null;" json:"avatar_url"`                               // 头像
	Region       string         `gorm:"column:region;type:varchar(50);comment:地区;not null;" json:"region"`                                        // 地区
	Introduction string         `gorm:"column:introduction;type:varchar(100);comment:简介;not null;" json:"introduction"`                           // 简介
	CreatedAt    time.Time      `gorm:"column:created_at;type:datetime(3);comment:创建时间;not null;" json:"created_at"`                              // 创建时间
	UpdatedAt    time.Time      `gorm:"column:updated_at;type:datetime(3);comment:更新时间;not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"` // 更新时间
	DeletedAt    gorm.DeletedAt `gorm:"column:deleted_at;type:datetime;comment:删除时间;default:NULL;" json:"deleted_at"`                             // 删除时间
	VideoId      uint           `gorm:"column:video_id;type:int UNSIGNED;not null;" json:"video_id"`
	CountNum     uint           `gorm:"column:count_num;type:int UNSIGNED;not null;" json:"count_num"`
	FollowNum    uint           `gorm:"column:follow_num;type:int UNSIGNED;not null;" json:"follow_num"`
	FansNum      uint           `gorm:"column:fans_num;type:int UNSIGNED;not null;" json:"fans_num"`
}

func (u *Users) TableName() string {
	return "users"
}
